import request from '../request.ts'

//获取
export const getPostList = async  (search:Object) => {
    let r:any = await request({
        url: '/system/post/list',
        method: 'get',
        loading: true,
        data:search
    })
    return {
        data:r.data.rows,
        total:r.data.total
    }
}

//新增
export const addPost = async  (data:Object) => {
    let r:any = await request({
        url: '/system/post/edit',
        method: 'post',
        loading: true,
        data:data
    })
    return r
}
//修改菜单资源 /system/menu
export const editPost = async  (data:Object) => {
    let r:any = await request({
        url: '/system/post/edit',
        method: 'put',
        loading: true,
        data:data
    })
    return r
}
//删除
export const delPost = async  (id:Number) => {
    let r:any = await request({
        url: '/system/post/delete',
        method: 'delete',
        loading: true,
        data:{
            postId:id
        }
    })
    return r
}